import 'package:flutter/cupertino.dart';
import 'package:imember/Util/Global.dart';
import 'package:imember/Util/MyColor.dart';
import 'package:imember/Widget/MyInput.dart';

class CustomerInfo extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _CustomerInfo();
  }
}

class _CustomerInfo extends State {
  @override
  Widget build(BuildContext context) {
    return Container(
        child: Column(children: [
      Container(height: 48),
      Input("姓氏", "請輸入姓氏"),
      Input("手機號碼", "請輸入手機號碼",inputType: NormalInput.Phone,),
      Input("邀請碼", "請輸入邀請碼"),
      Input("優惠碼", "請輸入兌換碼或掃碼"),
    ]));
  }
}

class Input extends StatelessWidget {
  String title;
  String hint;

  String? inputType;
  TextEditingController? controller;

  Input(this.title, this.hint, {this.inputType, this.controller});

  @override
  Widget build(BuildContext context) {
    return Row(mainAxisAlignment: MainAxisAlignment.center, children: [
      Container(width: 110, child: Text(title, style: TextStyle(fontSize: 16, color: MyColor.C70))),
      Container(
        decoration: Global.getBoxBg(20, MyColor.White),
        height: 39,
        width: 200,
        margin: EdgeInsets.fromLTRB(0, 8, 0, 8),
        padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
        child: NormalInput(textAlign: TextAlign.center, hintText: hint, fontSize: 16, inputType: inputType, controller: controller),
      )
    ]);
  }
}
